package com.api.rc.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author RenQiang
 * @date 2021/7/5
 */
@Data
@ApiModel(value = "主持人问题表单")
public class HostQuestionForm {
    @NotEmpty
    @ApiModelProperty(value = "问题")
    private String question;
    @NotEmpty
    @ApiModelProperty(value = "问题答案（选项）列表")
    @Valid
    private List<HostQuestionAnswer> answers;
    @NotNull
    @Min(1)
    @ApiModelProperty(value = "问题序号")
    private Integer order;
    @Data
    @ApiModel(value = "主持人问题答案表单")
    public static class HostQuestionAnswer {
        @NotEmpty
        @ApiModelProperty(value = "问题答案")
        private String answer;
        @NotNull
        @ApiModelProperty(value = "是否是正确答案")
        private Boolean isRight;
    }
}
